//
//  BMIDetailVc.swift
//  GjCup
//
//  Created by abc on 2024/4/8.
//

import UIKit

class BMIDetailVc: UIViewController {
    var bmi = 1.0
    @IBOutlet weak var bmiLa: UILabel!{
        didSet{
            bmiLa.text = String(format: "%.2f", bmi)
        }
    }
    
    @IBOutlet weak var fenxiLa: UILabel!
    
    @IBOutlet weak var bView: UIView!{
        didSet{
            bView.layer.cornerRadius = 12
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        fenxi()
    }
    
    func fenxi()  {
        if bmi <= 18 {
            fenxiLa.text = "分析: 体重偏瘦，需要注意饮食多摄入适量瘦肉、蛋类、富含维生素的水果、适量锻炼补充营养。"
        }else if bmi > 18 && bmi <= 24{
            fenxiLa.text = "分析: 体重正常，继续保持良好的饮食习惯，锻炼身体，保持身体健康。"
        }else if bmi > 24{
            fenxiLa.text = "分析: 体重偏胖需呀饮食控制、运动锻炼、保持良好作息、避免吸烟、控制情绪等，保持合理的体重，对身体健康有益。"
        }
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
